package com.marry.business.config;

import com.common.web.netty.socket.NettyHandleService;
import com.common.web.netty.socket.NettyServer;
import com.common.web.netty.socket.WebSocketHandler;
import com.marry.business.service.NettyHandleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @program: marry-cloud
 * @description: netty的配置类
 * @author: 杨超
 * @create: 2021-07-05 13:43
 **/
@Configuration
public class NettyConfig {

    @Value("${netty.port}")
    private  int nettyPort;


    @Autowired
    private NettyHandleService nettyHandleService;

    /**
    * 方法名: nettyHandleService
    * 功能描述: 配置netty服务类
    * 参数: []
    * 返回类型 com.common.web.netty.socket.NettyHandleService
    * 创建者:杨超
    * 创建时间:2021/7/5 14:34
    * 更新者:杨超
    * 更新时间:2021/7/5 14:34
    **/
    @Bean
    public NettyHandleService nettyHandleService(){
        return  new NettyHandleServiceImpl();
    }

    /**
    * 方法名: nettyServer
    * 功能描述: 配置netty类
    * 参数: []
    * 返回类型 com.common.web.netty.socket.NettyServer
    * 创建者:杨超
    * 创建时间:2021/7/5 14:34
    * 更新者:杨超
    * 更新时间:2021/7/5 14:34
    **/
    @Bean
    public NettyServer  nettyServer()  {
        NettyServer nettyServer = new NettyServer(nettyPort);
        return  nettyServer;
    }


    @PostConstruct
    public void nettyInit(){

   }




}
